package com.atguigu.gulimall.order.service;

import com.atguigu.common.to.SeckillOrderTo;
import com.atguigu.gulimall.order.vo.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.order.entity.OrderEntity;

import java.util.Map;

/**
 * 订单
 *
 * @author shendong
 * @email shendong@gmail.com
 * @date 2020-04-26 10:33:02
 */
public interface OrderService extends IService<OrderEntity> {
    /**
     * 分页查询
     * @param params
     * @return
     */
    PageUtils queryPage(Map<String, Object> params);

    /**
     * 返回需要的确认页数据
     * @return
     */
    OrderConfirmVo confirmOrder();

    /**
     * 提交订单功能
     * @param vo
     * @return
     */
    SubmitResponseVo submitOrder(OrderSubmitVo vo);

    /**
     * 根据订单Id查询订单状态
     * @param orderSn
     * @return
     */
    OrderEntity getOrderByOrderSn(String orderSn);

    /**
     * 关闭订单
     * @param entity
     */
    void closeOrder(OrderEntity entity);

    /**
     * 获取当前订单的支付信息
     * @param orderSn
     * @return
     */
    PayVo getOrderPay(String orderSn);

    /**
     * 分页查登录用户的订单详情
     * @param params
     * @return
     */
    PageUtils queryPageWithItem(Map<String,Object> params);

    /**
     *  处理支付宝返回数据
     * @param vo
     * @return
     */
    String handlePayResult(PayAsyncVo vo);

    /**+
     * 创建秒杀单的详细信息
     * @param seckillOrderTo
     */
    void createSeckillOrder(SeckillOrderTo seckillOrderTo);
}

